package com.ny.demo428;

import demo1.BankPay;
import demo1.Pay;
import demo1.WeixingPay;
import demo1.ZhifubaoPay;

import java.util.Scanner;

public class Zi extends Demo{

    @Override
    public void TestPay() {
        double money=15;
        System.out.println("支付金额为："+money);
        System.out.println("支付方式:1.银行卡支付 2.微信支付 3.支付宝支付");
        Scanner scanner=new Scanner(System.in);
        switch (scanner.nextInt()){
            case 1:
                Pay bankPay=new BankPay();
                bankPay.pay(money);
                break;
            case 2:
                Pay weixingPay=new WeixingPay();
                weixingPay.pay(money);
                break;
            case 3:
                Pay zhifubaoPay=new ZhifubaoPay();
                zhifubaoPay.pay(money);
                break;
        }
    }
}
